package com.example.homeworka;

public class Myclass {
    public static void main(String[] args) {
    Duck duck = new ReadHeadDuck();
    duck.display();
    duck.performQuack();
    duck.performFly();

    //改变飞行行为，不能飞了
    duck.setFlyBehavior(new FlyNoWay());
    duck.performFly();
    }
}
